<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" errorPage="/error.jsp" isELIgnored="false" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<%@ taglib uri="http://atleap.blandware.com/taglib" prefix="atleap" %>
<html:xhtml />

<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" scope="page" var="LAYOUT_COLLECTION_KEY" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="HTML_TEXT_FIELD_MAX_LENGTH" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="CONTENT_LOCALES_COLLECTION_KEY" scope="page" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="REDIRECT_URL_KEY" scope="page" />
<atleap:javascript formName="contentPageForm" staticJavascript="false" dynamicJavascript="true" method="validateForm" cdata="false" />
<atleap:content identifier="information" ignore="true" uri="/core/contentPage/callCreate"/>
<atleap:messages property="contentPageInvalidDate" />
<atleap:messages property="contentPageAlreadyExists" />
<atleap:messages property="contentPageIncorrectUri" /><br />
<atleap:form action="core/contentPage/create" method="POST">
	<table cellpadding="0"  cellspacing="0" border="0" class="modificationTable">
		<tr>
			<td colspan="2" align="center">
				<atleap:label property="title" key="core.page.form.title" colon="false" helpTip="true" />
			</td>
		</tr>
		<atleap:iterator items="${sessionScope[pageScope.CONTENT_LOCALES_COLLECTION_KEY]}" var="contentLocale">
			<tr>
				<th>
					<div class="languageField">
						<atleap:fieldValue valueMap="${contentLocale.title}" var="languageTitle" />
						<c:if test="${empty languageTitle}">
							<c:set var="languageTitle" value="${contentLocale.identifier}" />
						</c:if>
						*&nbsp;<atleap:message key="core.page.form.language" />:&nbsp;${languageTitle}
					</div>
				</th>
				<td>
					<html:text maxlength="${pageScope.HTML_TEXT_FIELD_MAX_LENGTH}" property="title(${contentLocale.identifier})" styleClass="text" />
				</td>
			</tr>
		</atleap:iterator>
		<tr>
			<td colspan="2" align="center">
				<atleap:label property="description" key="core.page.form.description" colon="false" helpTip="true" />
			</td>
		</tr>
		<atleap:iterator items="${sessionScope[pageScope.CONTENT_LOCALES_COLLECTION_KEY]}" var="contentLocale">
			<tr>
				<th>
					<div class="languageField">
						<atleap:fieldValue valueMap="${contentLocale.title}" var="languageTitle" />
						<c:if test="${empty languageTitle}">
							<c:set var="languageTitle" value="${contentLocale.identifier}" />
						</c:if>
						<atleap:message key="core.page.form.language" />:&nbsp;${languageTitle}
					</div>
				</th>
				<td>
					<html:text maxlength="${pageScope.HTML_TEXT_FIELD_MAX_LENGTH}" property="description(${contentLocale.identifier})" styleClass="text" />
				</td>
			</tr>
		</atleap:iterator>
		<tr>
			<td colspan="2" align="center">
				<atleap:label property="keywords" key="core.page.form.keywords" colon="false" helpTip="true" />
			</td>
		</tr>
		<atleap:iterator items="${sessionScope[pageScope.CONTENT_LOCALES_COLLECTION_KEY]}" var="contentLocale">
			<tr>
				<th>
					<div class="languageField">
						<atleap:fieldValue valueMap="${contentLocale.title}" var="languageTitle" />
						<c:if test="${empty languageTitle}">
							<c:set var="languageTitle" value="${contentLocale.identifier}" />
						</c:if>
						<atleap:message key="core.page.form.language" />:&nbsp;${languageTitle}
					</div>
				</th>
				<td>
					<html:text maxlength="${pageScope.HTML_TEXT_FIELD_MAX_LENGTH}" property="keywords(${contentLocale.identifier})" styleClass="text" />
				</td>
			</tr>
		</atleap:iterator>
        <tr>
            <td colspan="2"></td>
        </tr>		
		<tr>
			<th>
				<atleap:label property="uri" styleClass="label" key="core.page.form.uri" colon="false" helpTip="true" />
			</th>
			<td>
				<html:text property="uri" maxlength="${pageScope.HTML_TEXT_FIELD_MAX_LENGTH}" styleClass="text" />
			</td>
		</tr>
		<tr>
			<th>
				<atleap:label styleClass="label" property="layoutId" key="core.contentPage.form.layout" colon="false" helpTip="true" />
			</th>
			<td>
				<html:select property="layoutId">
					<html:optionsCollection  name="${pageScope.LAYOUT_COLLECTION_KEY}"
											 label="name" value="id" />
				</html:select>
			</td>
		</tr>
		<tr>
			<th>
				<atleap:label property="overrideFields" styleClass="label" key="core.contentPage.form.overrideFields" colon="false" helpTip="true" />
			</th>
			<td>
				<html:select property="overrideFields">
					<html:option value="all"><atleap:message key="core.contentPage.form.overrideFields.all" /></html:option>
					<html:option value="empty"><atleap:message key="core.contentPage.form.overrideFields.empty" /></html:option>
                    <html:option value="emptyIndexless"><atleap:message key="core.contentPage.form.overrideFields.emptyIndexless" /></html:option>
                    <html:option value="none"><atleap:message key="core.contentPage.form.overrideFields.none" /></html:option>
				</html:select>
			</td>
		</tr>
		<tr>
			<th>
				<atleap:label property="cacheMaxAge" styleClass="label" key="core.contentPage.form.cacheMaxAge" colon="false" helpTip="true" />
			</th>
			<td>
				<html:text property="cacheMaxAge" maxlength="${pageScope.HTML_TEXT_FIELD_MAX_LENGTH}" styleClass="text" />
			</td>
		</tr>
		<tr>
			<th>
				<atleap:label property="publicationDate" key="core.contentPage.form.publicationDate" colon="false" helpTip="true" />
			</th>
			<td nowrap="nowrap">
				<atleap:message key="core.commons.buttons.select" var="selectMsg" />
				<html:text property="publicationDate" styleClass="text" readonly="true" />
				<atleap:calendar fieldName="document.forms['contentPageForm'].publicationDate" showYearNavigation="true" showYearNavigationInput="true">
					<img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/calendar.gif" />" border="0" height="20" width="20" alt="${selectMsg}" title="${selectMsg}" />
				</atleap:calendar>
			</td>
		</tr>
		<tr>
			<th>
				<atleap:label property="expirationDate" key="core.contentPage.form.expirationDate" colon="false" helpTip="true" />
			</th>
			<td nowrap="nowrap">
				<atleap:message key="core.commons.buttons.select" var="selectMsg" />
				<html:text property="expirationDate" styleClass="text" readonly="true" />
				<atleap:calendar fieldName="document.forms['contentPageForm'].expirationDate" showYearNavigation="true" showYearNavigationInput="true">
					<img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/calendar.gif" />" border="0" height="20" width="20" alt="${selectMsg}" title="${selectMsg}" />
				</atleap:calendar>
			</td>
		</tr>
        <tr>
            <td colspan="2" align="right" nowrap="nowrap">
                <atleap:label styleClass="labelCheckbox"  property="publish" key="core.contentPage.form.publish" colon="false" helpTip="true" />
                <html:checkbox styleClass="checkbox" property="active"  />
            </td>
        </tr>
    </table>
    <atleap:submit styleClass="button"><atleap:message key="core.commons.buttons.create" /></atleap:submit>
    <atleap:cancel styleClass="button"><atleap:message key="core.commons.buttons.cancel" /></atleap:cancel>
</atleap:form>
